The BGRA extension, EXT_bgra, extends the list of host-memory color formats by an alternative to the RGBA format that uses reverse component order. The BGRA component order matches image data from DirectDraw and GDI bitmaps. Using the extension is the most convenient way to use a BGRA source image with OpenGL.
To use the extension, call glDrawPixels(), glGetTexImage(), glReadPixels(), and glTexImage*() with GL_BGRA_EXT as the value of the format parameter.
The following code fragment illustrates the use of the extension:
/* * draw a 32x32 pixel image at location 10, 10 using an BGRA source * image. "image" *should* point to a 32x32 BGRA UNSIGNED BYTE image */ { unsigned char *image; glRasterPos2f(10, 10); glDrawPixels(32, 32, GL_BGRA_EXT, GL_UNSIGNED_BYTE, image); }